﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CNRegex.Enum;
using Project.Common;

namespace CNRegex.Entity
{
	public class BaseSearch
	{
		private int? pageSize;
		public int? _PageSize
		{
			get
			{
				return  pageSize ?? ProjectGlobal.PAGE_SIZE;
			}
			set
			{
				pageSize = value ?? ProjectGlobal.PAGE_SIZE;
			}
		}

		/// <summary>
		/// 排序列名称
		/// </summary>
		public string _OrderName { get; set; }

		/// <summary>
		/// 排序方向
		/// </summary>
		private int? orderDirection;
		public int? _OrderDirection
		{
			get
			{
				return orderDirection == null ? (int)EnumOrder.DESC : orderDirection.Value;
			}
			set
			{
				orderDirection = value ?? (int)EnumOrder.DESC;
			}
		}

		/// <summary>
		/// 获取排序方向
		/// </summary>
		public EnumOrder EnumOrderDirection
		{
			get
			{
				return (EnumOrder)_OrderDirection;
			}
		}

		private string commonSearchCondition;
		/// <summary>
		/// 页面右上角通用的查询条件
		/// </summary>
		public string _CommonSearchCondition
		{
			get
			{
				return "请输入查询条件".Equals(commonSearchCondition) ? null : commonSearchCondition;
			}
			set
			{
				commonSearchCondition = value;
			}
		}
	}
}